package org.holynite.fieldmanage.ejbs

import org.holynite.fieldmanage.Utils.ManagementException
import org.holynite.fieldmanage.entities.AdministratorRole
import org.holynite.fieldmanage.types.Privileges

import javax.ejb.Remote

/**
 * Created by midnite on 15/1/10.
 */
@Remote
interface AuthorizationManagement {
	void addRole(AdministratorRole newRole) throws ManagementException
	void saveRole(AdministratorRole role) throws ManagementException
	Boolean removeRole(Object key) throws ManagementException
	List<AdministratorRole> listAllRoles()
	List<AdministratorRole> listAllDetailedRoles()
	AdministratorRole fillPrivilege(AdministratorRole role)
	AdministratorRole fetchRole(String roleId)

	Boolean checkRoleHasPrivilege(AdministratorRole role, Privileges privilege)
	List<Privileges> getAllPrivileges()
}